﻿using System;
using System.Collections.Generic;
using System.Linq;
using Monkey.Warrenty.Data.Interfaces;
using Monkey.Warrenty.EntityModel;

namespace Monkey.Warrenty.Data
{
    public class ReportingDao: IReportingDao
    {
        public List<ReportEmployeeInstantTicket_Result> ReportEmployeeInstantTicket(DateTime? dateFrom, DateTime? dateTo)
        {
            if (!dateFrom.HasValue && !dateTo.HasValue)
            {
                return new List<ReportEmployeeInstantTicket_Result>();
            }

            using (var db = new MonkeyWarrantyEntities())
            {
                return db.ReportEmployeeInstantTicket(dateFrom, dateTo).ToList();
            }
        }
    }
}
